unit u_pesquisaformafarmaceutica;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, u_pesquisapadrao, FMTBcd, DB, DBClient, Provider, SqlExpr,
  Grids, DBGrids, JvExDBGrids, JvDBGrid, StdCtrls, AdvEdit, AdvGlowButton,
  ExtCtrls, AdvGroupBox;

type
  TFRM_PesquisaFormaFarmaceutica = class(TFRM_PesquisaPadrao)
    cdsPesquisarCOD_FORMA: TIntegerField;
    cdsPesquisarDESCRICAO: TStringField;
    cdsPesquisarGRUPO_FF: TStringField;
    cdsPesquisarCATEGORIA_FF: TStringField;
    cdsPesquisarVALIDADE: TStringField;
    cdsPesquisarINVOLUCRO_TIPO: TStringField;
    cdsPesquisarCOD_INVOLUCRO_TIPO: TIntegerField;
    procedure edtPesquisarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure FormShow(Sender: TObject);

  public
    function PesquisarListaForma(Empresa: integer): boolean;

  end;

var
  FRM_PesquisaFormaFarmaceutica: TFRM_PesquisaFormaFarmaceutica;

implementation

{$R *.dfm}

procedure TFRM_PesquisaFormaFarmaceutica.edtPesquisarKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  cdsPesquisar.Locate('descricao',edtPesquisar.Text,[loPartialKey,loCaseInsensitive]);
end;

procedure TFRM_PesquisaFormaFarmaceutica.FormShow(Sender: TObject);
begin
  inherited;
  lblTotal.Caption := lblTotal.Caption + ' Formas';
end;

function TFRM_PesquisaFormaFarmaceutica.PesquisarListaForma(Empresa: integer): boolean;
begin
  cdsPesquisar.Close;
  sqlPesquisar.Params[0].AsInteger := Empresa;
  cdsPesquisar.Open;
  if cdsPesquisar.IsEmpty then Result := false else Result := true;
end;

end.
